import React, { Component } from 'react';
import HomeList from './components/list'
import HomeUl from './components/ul'
import HomeCompont from './components/compont'
import { HomeWrap, HomeLeft, HomeRight } from "./style"
import {actionCreators} from './store'
import { connect } from 'react-redux'
class Home extends Component {
    render() {
        return (<HomeWrap>
            <HomeLeft>
                <img className="banner-img" alt="1" src="https://upload-images.jianshu.io/upload_images/11864358-2c5f48f03dffb247.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/360/h/240"></img>
                <HomeUl></HomeUl>
                <HomeList> </HomeList>
            </HomeLeft>
            <HomeRight>
                <HomeCompont></HomeCompont>
            </HomeRight>
        </HomeWrap>)
    }
    componentDidMount() {
     this.props.changeIndexData();
    }
}
const mapDispatchToProps = (dispatch, ownProps) => {
    return {
        changeIndexData: () => {
           const action = actionCreators.getList();
           dispatch(action)
        }
    }
}

export default connect(null, mapDispatchToProps)(Home) 